//
//  CYDaoShiLieBiaoTableViewCell.m
//  cyydt
//
//  Created by chu on 2019/2/3.
//  Copyright © 2019 chu. All rights reserved.
//

#import "CYDaoShiLieBiaoTableViewCell.h"
#import "CYPubilishQuestionViewController.h"

@implementation CYDaoShiLieBiaoTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.headImageView.layer.cornerRadius = self.headImageView.frame.size.height / 2;
    self.headImageView.layer.masksToBounds = YES;
    
    self.tiwenBtn.layer.cornerRadius = 2;
    self.tiwenBtn.layer.masksToBounds = YES;
    self.tiwenBtn.layer.borderWidth = 1;
    self.tiwenBtn.layer.borderColor = RGBOF(0xF43636).CGColor;

}
- (IBAction)tiwenAction:(UIButton *)sender {
    CYPubilishQuestionViewController *tiwen = [[CYPubilishQuestionViewController alloc] init];
    tiwen.type = TiWenType_XiangTaTiWen;
    tiwen.nickname = self.model.nickName;
    [[AppDelegate sharedAppDelegate] pushViewController:tiwen];
}

- (void)setModel:(CYFriendModel *)model{
    _model = model;
    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:[UIImage imageWithColor:[UIColor lightGrayColor] Size:self.headImageView.frame.size]];
    self.label1.text = model.nickName;
    self.label2.text = [NSString stringWithFormat:@"擅长领域:%@",model.cateName];
    self.label3.text = [NSString stringWithFormat:@"%@粉丝  %@回答",model.fansNum, model.helpNum];

    self.shenfenImageView.hidden = NO;
    if ([model.tag isEqualToString:@"1"]) {
        //普通
        self.shenfenImageView.hidden = YES;
        
    }else if ([model.tag isEqualToString:@"2"]){
        //导师号
        self.shenfenImageView.image = [UIImage imageNamed:@"wd_gezl_dsbq"];
    }else if ([model.tag isEqualToString:@"3"]){
        //官方号
        self.shenfenImageView.image = [UIImage imageNamed:@"wd_gezl_gfbq"];
    }else{
        //项目号
        self.shenfenImageView.image = [UIImage imageNamed:@"标签"];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
